<?php
/**
 * Created by PhpStorm.
 * User: linvscode
 * Date: 2018/8/1
 * Time: 20:43
 */
namespace IMooc\Database;

use IMooc\IDatabase;

class MySQLi implements IDatabase
{
    protected $conn;
    function connect($host, $user, $pwd, $dbname)
    {
        $conn = mysqli_connect($host, $user, $pwd);
        mysqli_select_db($dbname, $conn);
        $this->conn = $conn;
    }

    function query($sql)
    {
        // TODO: Implement query() method.
        return mysqli_query( $this->conn, $sql);
    }

    function close()
    {
        // TODO: Implement close() method.
        mysqli_close($this->conn);
    }
}